<template>
  <div class="gallary" @click.stop="handleGallaryClick">
    <div class="wapper">
      <swiper :options="swiperOption">
        <!-- slides -->
        <swiper-slide>
          <img class="gallary-img" src="../../assets/images/04b92c99462687fa1ba45c1b5ba4ad77.jpg_800x800_70debc93.jpg" alt="">
        </swiper-slide>
        <swiper-slide>
          <img class="gallary-img" src="../../assets/images/7691528bc7d7ad3ca3.img.png_800x800_9ef05ee7.png" alt="">
        </swiper-slide>
        <!-- Optional controls -->
        <div class="swiper-pagination"  slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Gallary',
  data () {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination',
          type: 'fraction'
        }
      }
    }
  },
  methods: {
    handleGallaryClick () {
      this.$emit('close')
    }
  }
}
</script>

<style lang="stylus" scoped>
  .gallary >>> .swiper-container
    overflow: inherit
  .gallary
    z-index 99
    position: fixed
    top: 0
    left: 0
    right: 0
    bottom: 0
    background-color: #000
    display flex
    flex-direction column
    justify-content center
    .wapper
      width:100%
      padding-bottom:100%
      /*background-color: #fff*/
      /*设置了高为0,就可以将页面放在padding上*/
      height: 0
      .gallary-img
        width:100%
      .swiper-pagination
        color: #FFF
        bottom -1rem
</style>
